package com.youths.domain;

import com.youths.util.StringUtil;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: KingRainGrey
 * Date: 2020/7/19
 */
public class Record extends Page{
    private String recordId;
    private String taskStr;

    private String addTime;
    private String doneTime;

    private String sliceStr;
    private String stateStr;
    private Integer state;


    public Record() {}

    public String getRecordId() {
        return recordId;
    }

    public void setRecordId(Integer recordId) {
        this.recordId = (10000000 + recordId) + "";
    }

    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.addTime = sdf.format(addTime);
    }

    public String getDoneTime() {
        return doneTime;
    }

    public void setDoneTime(Date doneTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.doneTime = sdf.format(doneTime);
    }

    public String getSliceStr() {
        return sliceStr;
    }

    public void setSliceStr(Integer sliceId) {
        this.sliceStr = StringUtil.encryption(sliceId);
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getStateStr() {
        return stateStr;
    }

    public String getTaskStr() {
        return taskStr;
    }

    public void setTaskStr(Integer taskId) {
        this.taskStr = StringUtil.encryption(taskId);
    }

    public void setStateStr(Integer state) {
        switch (state){

            case 4:
                this.stateStr = "已评级";
                break;
            case 5:
                this.stateStr = "已完成";
                break;
            default:
                this.stateStr = "未评级";
                break;
        }

    }
}
